use serde::Deserialize;
use validator::Validate;

#[derive(Deserialize, Validate)]
pub struct Login {
    #[validate(length(max = 255))]
    pub email: String,

    #[validate(length(min = 6))]
    pub password: String,

    #[validate(length(min = 36))]
    pub captcha: String,
}

#[derive(Deserialize, Validate)]
pub struct Register {
    #[validate(length(max = 255))]
    pub email: String,

    #[validate(length(min = 6))]
    pub password: String,

    #[validate(length(min = 6))]
    pub re_password: String,

    #[validate(length(min = 36))]
    pub captcha: String,
}
